package org.catdroid.spora;
import java.io.IOException;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.catdroid.spora.bean.Locations;
import org.catdroid.spora.bean.Location;
import org.catdroid.spora.html.DataHarvester;

@SuppressWarnings("serial")
public class LocationsServlet extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
		DataHarvester dh=new DataHarvester("http://lap.uab.cat/aerobiologia/ca/forecast/catalunya");
		Locations locations=dh.getLocations();
		resp.setContentType("text/plain");
		resp.getWriter().println("Hola");
		for (Location location:locations) {
			resp.getWriter().print(location.getId());
			resp.getWriter().println(location.getName());
		}
	}
	
	
	
}
